package cn.skyquant.quant4j.service.boot.web.vo;

import com.google.common.collect.Lists;
import com.google.common.collect.Sets;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

public class MenuVO implements Serializable{
    private static final long serialVersionUID = 2341123L;
    public final String label;
    public final String url;
    public final String icon;
    public final short sort;
    public final List<MenuItemVO> items = Lists.newArrayList();
    public MenuVO(String label, String url,String icon, short sort, MenuItemVO... menuItemVOS) {
        this.label = label;
        this.url = url;
        this.icon = icon;
        this.sort = sort;
        if(menuItemVOS !=null){
            for(MenuItemVO item: menuItemVOS){
                items.add(item);
            }
        }
    }

    public void add(MenuItemVO menuItemVO){
        items.add(menuItemVO);
    }


    @Override
    public String toString() {
        return String.format("<a href='%s'>%s<//a>",url,label);
    }
}
